﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BookingSystemBLL;
using System.Data;

public partial class PreBookingTicket : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindFlight();
           // BindUser();
        }
    }

    public void BindFlight()
    {
        string FlightNumber = Session["FlightNumber"].ToString();
        DataSet ds = FlightBLL.GetFlightByFlightNumber(FlightNumber);
        this.GridView_lookup.DataSource = ds.Tables[0];
        this.GridView_lookup.DataBind();
    }

    public void BindUser()
    {
        DataSet ds = UserBLL.SearchUser();
        this.Gridview_User.DataSource = ds.Tables[0];
        this.Gridview_User.DataBind();
    }
    //提交订单
    protected void OK_Click(object sender, EventArgs e)
    {
        for (int i = 0; i < Request.Form.Count; i++)
        {
            if (Request.Form.Keys[i].ToString().ToLower().EndsWith("inputSufix$"))
            {

            }
            if (!string.IsNullOrEmpty(Request["UserName"]))
            {
                string[] strCardes = Request["UserName"].Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                foreach (string strCard in strCardes)
                {
                    //to do
                }
            }
            //string[] res = OrderTicket(UserName.value, UserName.value, UserName.value, UserName.value);
            //list.Add(res);
        }
    }

    public string[] OrderTicket(string SeatType, string UserName, string IDCar, string Phone)
    {
        string[]res=new string[4];
        res[0]=SeatType;
        res[1]=UserName;
        res[2]=IDCar;
        res[3]=Phone;
        return res;
    }
    //取消
    protected void Cancell_Click(object sender, EventArgs e)
    {

    }
}